<!DOCTYPE html>
<customCss>
<style>
span.error {
	color: red;
}
</style>
</customCss>
<section class="content-header" style="padding: 3px 15px 0 15px;">
	<ol class="breadcrumb" id="nav_title"
		style="position:static;float:none;margin-bottom: 5px;">
		<li class="active"><i class="fa fa-home"
			style="font-size:20px;position:relative;top:2px;left:-3px;"></i>
			&nbsp; <a href="${rc.contextPath}/sys/index">首页</a>
		</li>
		<li class="active">系统管理</li><li class="active">登录日志</li>
	</ol>
</section>
<div class="container-fluid">
	<div class="box box-primary">
		<div id="toolbar">
			<label style="font-size: small">用户名：</label> <input id="user_name"
				type="text" class="form-control"
				style="width:100px;height:25px;font-size: small;display: inline-block;border-radius: 5px;">

			<label style="font-size: small">日期：</label> <input
				id="selectFromDate" type="text" class="laydate-icon"
				style="width:120px;height:25px;font-size:small;display: inline-block;border-radius: 5px;">
			<label style="font-size: small">至</label> <input id="selectToDate"
				type="text" class="laydate-icon"
				style="width:120px;height:25px;font-size:small;display: inline-block;border-radius: 5px;">
			<button id="searchBtn" type="button" class="btn"
				style="margin-left:20px;padding:3px 18px;background:#3399fe;color:#fff;">查看</button>
		</div>
		<div class="row">
			<table id="table" data-toggle="table" data-url="queryUserLog"
				data-toolbar="#toolbar" data-pagination="true" data-striped="true"
				data-search="true" data-page-size="10">
				<thead>
					<tr>
						<th data-align="center" data-field="user_name"
							data-sortable="true">用户名</th>
						<th data-align="center" data-field="login_name"
							data-sortable="true">登录名</th>
						<th data-align="center" data-field="ip" data-sortable="true">ip地址</th>
						<th data-align="center" data-field="login_time"
							data-sortable="true" data-formatter="dateformate">登录时间</th>
						<th data-align="center" data-field="status"
							data-formatter="operateStatus" data-events="operateEvents">状态</th>
					</tr>
				</thead>
			</table>
		</div>
	</div>
</div>
<customScript> <script type="text/javascript">
			function operateStatus(value, row, index) {
				var status = row.status;
				if(status == 0){
					return [
						"<span style='color: red;'>异常</span>"
					].join('');	
				}
				if(status == 1){
					return [
						"<span style='color: green;'>正常</span>"
					].join('');	
				}
			}
			
			function dateformate(value,row,index){
				var date = row.login_time;
				var dateFormatter = new Date(date);
				var year = dateFormatter.getFullYear();
				var month = parseInt(dateFormatter.getMonth())+1;
				var date = dateFormatter.getDate();
				var hour = dateFormatter.getHours();
				var minute = dateFormatter.getMinutes();
				var second = dateFormatter.getSeconds();
				return year+"年"+month+"月"+date+"日"+"  "+hour+":"+double(minute)+":"+double(second);
			}
			
			function double(n){
				return n<10?'0'+n:''+n;
			}
		</script> <script type="text/javascript"
	src="${rc.contextPath}/assets/lib/laydate/laydate.js"></script> <script
	type="text/javascript" src="${rc.contextPath}/views/admin/system/sysuserlog.js"></script>
</customScript>